import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

//特殊车辆配件类型保修期维护-主机厂

//特殊车辆配件类型保修期维护-主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPSpecialPtOil/getListByPage`,  params );
//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rPSpecialPtOil/saveOne`,  params );
export const deleteOne = data => axios.post(`${SERVER.CLAIMFAC}/rPSpecialPtOil/updateStatusById`,  null ,{params : data} );
export const excelExport = params => {
  return axios({
    url:`${SERVER.CLAIMFAC}/rPSpecialPtOil/getListForExport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//特殊车辆配件类型保修期编辑弹窗的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPSpecialPtOil/updateByPtId`,  params );

//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rPSpecialPtOil/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rPSpecialPtOil/getListForExport`, params, {
    responseType: 'blob'
  });

//获取经销商
export const getCarList = params =>
  axios.get(`${SERVER.CLAIMFAC}/const/getCarList`, {
    params
  });
export const getTjdetail = params =>
  axios.get(`${SERVER.CLAIMFAC}/rPSpecialPtOil/selectById`, {
    params
  });

//下载中心导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);